home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 5373 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.3 KB

  1. Path: news.central.ntua.gr!not-for-mail
  2. From: hnick@central.ntua.gr (Nick C. Fotis)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Ceck out this bug. What the *** is SASC/6.56 doing?
  5. Date: 13 Mar 1996 14:17:49 GMT
  6. Organization: National Technical University of Athens, Greece
  7. Message-ID: <4i6led$stj@zeus.central.ntua.gr>
  8. References: <1120.6643T91T406@login.eunet.no> <4hvk1f$o0c@zeus.central.ntua.gr>     <874.6644T381T2315@login.eunet.no> <4i17ga$doo@btmpjg.god.bel.alcatel.be> <885.6646T9T693@login.eunet.no>
  9. NNTP-Posting-Host: gate2-zeus.central.ntua.gr
  10. X-Newsreader: NN version 6.5.0 #1 (NOV)
  11.  
  12. patrick.hanevold@login.eunet.no (Patrick Hanevold) writes:
  13.  
  14.  
  15. >>>Tryed "Stack check" and all that. No difference.
  16. >>>Anyway, the default stack is 4K isnt it?
  17. >>>Cant think of anything using that additional 1K.
  18. >>>Dont want it global. Allocate it myself now.
  19. >>>
  20. >>OpenScreenTags() need stack too!! Together with the already used stack
  21. >>by _main, and the 3252 bytes of main(), you only have about 800 bytes
  22. >>left for OpenScreenTags(), might be too small. Stackcheck will not
  23. >>find this, because stackcheck does not know the stack-usage of
  24. >>OpenScreenTags().
  25.  
  26. >OpenScreenTags() doesnt crash. exit(0) does.
  27. >I guess it maby could mess up so exit(0) would crash.
  28. >Stach check should be smart enough to fail if there was too litle stack left.
  29. >I would guess none of the OS calls would need more then 4K since thats the
  30. >default stack size.
  31.  
  32. exit(0) probably crashes cause it peeks a wrong return address from the stack
  33. You are right OS calls need no more than 4k but when you call the OpenScreen-
  34. Tags you are left with less than one kilobyte of stack.
  35.  
  36. I dont think a compiler can ever check if stack will overflow when a call
  37. will be made to a function that wasn't compiled so to include code for
  38. stack checking.
  39.  
  40. My guess is that if you had the OS source and you had compiled it with 'stack
  41. checking' then your program wouldn't crash.
  42.  
  43.  
  44. ><sb>Patrick Hanevold - Virtual Reality developer
  45. ><sb>patrick.hanevold@login.eunet.no
  46. ><sb>Amiga and official Be developer
  47.  
  48. --
  49.  
  50. +----------------------------------------------------------------------------+
  51. | Alkinoos Alexandros Argiropoulos                  A1200, '030@40, 6MB Fast |
  52. | Athens, Greece                       "AAA is not a chipset...It's my name" |
  53. +----------------------------------------------------------------------------+
  54.